﻿//Created by Action Script Viewer - http://www.buraks.com/asv
package Mechanics.GameEventMechanics {
    import Mechanics.GameMechanicInterfaces.*;
    import Mechanics.*;
    import Classes.*;
    import Classes.util.*;
    import Mechanics.Transactions.*;

    public class MallUpgradeMechanic extends UpgradeMechanic {

        override protected function preUpgradeForGameAction(_arg1:String, _arg2:Array=null):void{
            var _local4:IActionGameMechanic;
            var _local5:MechanicActionResult;
            var _local6:MechanicMapResource;
            var _local3:String = String(m_config.params["friend"]);
            if (_local3.length){
                _local4 = (MechanicManager.getInstance().getMechanicInstance(m_owner, _local3, _arg1) as IActionGameMechanic);
                if (_local4.hasOverrideForGameAction(_arg1)){
                    _local5 = _local4.executeOverrideForGameEvent(_arg1, _arg2);
                    if (((_local5) && (_local5.sendTransaction))){
                        _local6 = (m_owner as MechanicMapResource);
                        GameTransactionManager.addTransaction(new TMechanicAction(_local6, _local3, _arg1, _local5.transactionParams));
                    };
                };
            };
        }

    }
}//package Mechanics.GameEventMechanics 
